import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class AG6 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int row = scan.nextInt();
		while (--row >= 0) {
			int n = scan.nextInt();//10^9
			int m = scan.nextInt();//10^9
			
			Map<Integer, Integer> countMap = new HashMap<>();
			boolean flag = true;
			for (int i = 1; i <= m; i++) {
				int count = countMap.getOrDefault(n % i, 0);
				if (count > 0) {
					System.out.println("Yes");
					flag = false;
					break;
				}
				countMap.put(n % i, count + 1);
			}
			if (flag) System.out.println("No");
		}
	}
}
